package com.ican.oc.domain;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="category")
public class OcCategory implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy=IDENTITY)
    @Column(name = "category_id", unique = true, nullable = false)
    private Integer categoryId;
    @Column(name="image")
    private String image;
    @Column(name="parent_id")
    private Integer parentId;
    @Column(name="top")
    private byte top;
    @Column(name="`column`")
    private Integer column;
    @Column(name="sort_order")
    private Integer sortOrder;
    @Column(name="status")
    private byte status;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "date_added", length = 19)
    private Date dateAdded;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "date_modified", length = 19)
    private Date dateModified;
    
    public OcCategory(){
        
    }
    
    public OcCategory(Date dateAdd){
        this.column = 0;
        this.dateAdded = dateAdd;
        this.dateModified = dateAdd;
        this.image = "";
        this.parentId = 0;
        this.sortOrder = 0;
        this.status = (byte)0;
        this.top = (byte)0;
    }
        
    public Integer getCategoryId() {
        return categoryId;
    }
    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }
    public String getImage() {
        return image;
    }
    public void setImage(String image) {
        this.image = image;
    }
    public Integer getParentId() {
        return parentId;
    }
    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }
    public byte getTop() {
        return top;
    }
    public void setTop(byte top) {
        this.top = top;
    }
    public Integer getColumn() {
        return column;
    }
    public void setColumn(Integer column) {
        this.column = column;
    }
    public Integer getSortOrder() {
        return sortOrder;
    }
    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }
    public byte getStatus() {
        return status;
    }
    public void setStatus(byte status) {
        this.status = status;
    }
    public Date getDateAdded() {
        return dateAdded;
    }
    public void setDateAdded(Date dateAdded) {
        this.dateAdded = dateAdded;
    }
    public Date getDateModified() {
        return dateModified;
    }
    public void setDateModified(Date dateModified) {
        this.dateModified = dateModified;
    }
}
